<div ng-controller="StoredistributionCtrl" ng-init="itemAction()">
    <ul class="sui-breadcrumb">
        <li> <a href="#/storedistribution/grouplist">{{'店铺分销'|translate}}</a></li>
        <li>
            商品分账比例列表
        </li>
        <span class="sui-form sui-form pull-right">
            <span>
                商品编号: <input type="text" name="" ng-model="item_id" >
            </span>
        <span>
                商品关键字: <input type="text" name="" ng-model="keyword" >
                <button class="sui-btn btn-success" ng-click="search()">
                    搜索
                </button>
            </span>
        </span>
    </ul>
    <form class="sui-form">
        <table class="sui-table table-bordered">
            <thead>
                <tr>
                    <th>{{'商品'|translate}}</th>
                    <th>{{'操作'|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="value in items">
                    <td width="15%">
                        {{value.title}}
                        <br/>
                        <img ng-src="{{value.img}}" style="width: 100px;height: 100px">
                        <br />
                        <button class="btn" ngclipboard data-clipboard-text="{{value.item_id}}" ngclipboard-success="onSuccess(e,this);">
                            {{value.item_id}}
                        </button>
                    </td>
                    <td width="85%">
                        <table class="sui-table table-bordered">
                            <thead>
                                <tr>
                                    <th>{{'#'|translate}}</th>
                                    <th>{{'sku条形码'|translate}}</th>
                                    <th>{{'价格'|translate}}</th>
                                    <th>{{'规格'|translate}}</th>
                                    <th>{{'分账类型'|translate}}</th>
                                    <th>{{'r1账号分账比例'|translate}}</th>
                                    <th>{{'r2账号分账比例'|translate}}</th>
                                    <th>{{'r3账号分账比例'|translate}}</th>
                                    <th>{{'r4账号分账比例'|translate}}</th>
                                    <th>{{'r5账号分账比例'|translate}}</th>
                                    <th></th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-repeat="list in value.sku">
                                    <td width="5%">
                                        <input type="checkbox" name="barcode" checklist-model="$parent.$parent.barcode" checklist-value="list" ng-change="check(list, checked)" />
                                    </td>
                                    <td width="10%">{{list.barcode}}</td>
                                    <td width="5%">{{list.price}}</td>
                                    <td width="10%">{{list.sku_properties}}</td>
                                    <td width="5%">
                                        <fz-money-type ng-model="list.money_type"></fz-money-type>
                                    </td>
                                    <td width="10%">
                                        <input name="r1" ng-model="list.r1" class="input-small">
                                        <span ng-show="list.money_type == 1">%</span>
                                        <span ng-show="list.money_type == 2">元</span>
                                    </td>
                                    <td width="10%">
                                        <input name="r2" ng-model="list.r2" class="input-small">
                                        <span ng-show="list.money_type == 1">%</span>
                                        <span ng-show="list.money_type == 2">元</span>
                                    </td>
                                    <td width="10%">
                                        <input name="r3" ng-model="list.r3" class="input-small">
                                        <span ng-show="list.money_type == 1">%</span>
                                        <span ng-show="list.money_type == 2">元</span>
                                    </td>
                                    <td width="10%">
                                        <input name="r4" ng-model="list.r4" class="input-small">
                                        <span ng-show="list.money_type == 1">%</span>
                                        <span ng-show="list.money_type == 2">元</span>
                                    </td>
                                    <td width="10%">
                                        <input name="r5" ng-model="list.r5" class="input-small">
                                        <span ng-show="list.money_type == 1">%</span>
                                        <span ng-show="list.money_type == 2">元</span>
                                    </td>
                                    <td width="8%">
                                        <button class="sui-btn btn-primary" ng-click="saveOneData(list)">
                                            保存
                                        </button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>
        <div>
            <span style="margin-left: 461px" ng-show="barcode">
                 <table class="sui-table table-bordered">
                    <thead>
                        <tr>
                            <th>批量设置</th>
                            <th>{{'r1账号分账比例'|translate}}</th>
                            <th>{{'r2账号分账比例'|translate}}</th>
                            <th>{{'r3账号分账比例'|translate}}</th>
                            <th>{{'r4账号分账比例'|translate}}</th>
                            <th>{{'r5账号分账比例'|translate}}</th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr >
                            <td width="15%">
                                    
                            </td>
                            <td width="15%">
                                    <input name="r1" ng-model="checkdata.r1" class="input-small">%
                            </td>
                            <td width="15%">
                                <input name="r2" ng-model="checkdata.r2" class="input-small"> %
                            </td >
                            <td width="15%">
                                <input name="r3" ng-model="checkdata.r3" class="input-small">%
                            </td>
                            <td width="15%">
                                <input name="r4" ng-model="checkdata.r4" class="input-small">% 
                            </td>
                            <td width="15%">
                                <input name="r5" ng-model="checkdata.r5" class="input-small">% 
                            </td>
                            <td width="15%">
                                <button class="sui-btn btn-primary"  ng-click="saveData()">
                                批量保存
                                </button>
                            </td>
                        </tr>
                    </tbody>
                </table>   
                </span>
            <button class="sui-btn btn-success">
                <span  ng-click="checkedAll()">全选</span>
                </button>
            <button class="sui-btn btn-success">
                    <span ng-click="checkedNotAll()">反选</span>
                </button>
        </div>

        <!-- <button class="sui-btn btn-success" ng-click="checkedAll()">全选</button> -->
        <pager page-no="1" page-size="pageSize" total="Total" get-data="getFzItemList(pageNo)"></pager>

    </form>
</div>